#Network
Open Systems Interconnection
![[7-Layers-of-the-OSI-Model.jpg]]
Upper layers
7.Application layer : FTP, HTTP, SMTP, NTP, IMAP and all network protocols 6.Presentation layer : VNC and RDP (remote desktop), Teamviewer/Anydesk, SSH, GUI, SSL, TLS 5.Session layer : Login, A session could also be on SQL or DB or AD 4.Transport layer : TCP and UDP
Material/physical layers
3.Network layer : Router, IPv4 and IPv6, IPSEC, ICMP (ping) 2.Liaison layer : MAC, Pont, Switch, wifi with MAC filtrage, 1.Physical layer : cables, prises and all, wifi, infrared, bluetooth, usb, IEEE 1394, bits, PPPoE (point to point over ethernet, used with ADSL - not used anymore), signal repetators, Hub, Ethernet
A black head hacker would attack to [[Gateway]] first, because all the data is passing there.
Diagram can be viewed here: [[LAN and Switch System.canvas|LAN and Switch System]]
| Upper Layers | Data |
|---|---|
| Transport Layer | Data + TCP header |
| Network Layer | Data + TCP header + IP header |
| Frame Layer | Data + TCP header + IP header + Frame Header + Frame Footer |
| Physical Layer | Physic to binary |
![[Pasted image 20240229085910 1.png]]
[[Classes/Systems/SQL]] Ports and Protocols
![[Pasted image 20240229095201.png]]
๐น Step 1: When Device A sends data to Device B over the network via the HTTP protocol, it is first added an HTTP header at the application layer.
๐น Step 2: Then a TCP or a UDP header is added to the data. It is encapsulated into TCP segments at the transport layer. The header contains the source port, destination port, and sequence number.
๐น Step 3: The segments are then encapsulated with an IP header at the network layer. The IP header contains the source/destination IP addresses.
๐น Step 4: The IP datagram is added a MAC header at the data link layer, with source/destination MAC addresses.
๐น Step 5: The encapsulated frames are sent to the physical layer and sent over the network in binary bits.
๐น Steps 6-10: When Device B receives the bits from the network, it performs the de-encapsulation process, which is a reverse processing of the encapsulation process. The headers are removed layer by layer, and eventually, Device B can read the data.
![[Pasted image 20240324145830.png]]